﻿using System;
using System.Collections.Generic;

namespace SharpSqlAnalyzer.pp.mediator.type
{
	// Token: 0x0200026A RID: 618
	public class KeywordAlignMediator : AbstractMediator
	{
		// Token: 0x06001367 RID: 4967 RVA: 0x0031EC7C File Offset: 0x0031CE7C
		public virtual void addIndentLevelItem(TSourceToken token, int curIndentLen)
		{
			if (!this.indentLevels.ContainsKey(new int?(this.curLevel)))
			{
				this.indentLevels[new int?(this.curLevel)] = new List<KeywordAlignMediator.IndentLevelItem>();
			}
			this.indentLevels[new int?(this.curLevel)].Add(new KeywordAlignMediator.IndentLevelItem(this.curLevel, curIndentLen, token));
		}

		// Token: 0x17000351 RID: 849
		// (get) Token: 0x06001368 RID: 4968 RVA: 0x0031ECE4 File Offset: 0x0031CEE4
		public virtual int CurLevelIndentLen
		{
			get
			{
				if (this.indentLevels.ContainsKey(new int?(this.curLevel)))
				{
					IEnumerable<KeywordAlignMediator.IndentLevelItem> enumerable = this.indentLevels[new int?(this.curLevel)];
					int num = 0;
					foreach (KeywordAlignMediator.IndentLevelItem indentLevelItem in enumerable)
					{
						if (indentLevelItem.IndentLen > num)
						{
							num = indentLevelItem.IndentLen;
						}
					}
					return num;
				}
				return 0;
			}
		}

		// Token: 0x06001369 RID: 4969 RVA: 0x0031ED68 File Offset: 0x0031CF68
		public virtual int getLevelIndentLen(int level)
		{
			if (this.indentLevels.ContainsKey(new int?(level)))
			{
				IEnumerable<KeywordAlignMediator.IndentLevelItem> enumerable = this.indentLevels[new int?(level)];
				int num = 0;
				foreach (KeywordAlignMediator.IndentLevelItem indentLevelItem in enumerable)
				{
					if (indentLevelItem.IndentLen > num)
					{
						num = indentLevelItem.IndentLen;
					}
				}
				return num;
			}
			return 0;
		}

		// Token: 0x17000352 RID: 850
		// (get) Token: 0x0600136A RID: 4970 RVA: 0x0031EDE4 File Offset: 0x0031CFE4
		public virtual int CurrentIndentLevel
		{
			get
			{
				return this.curLevel;
			}
		}

		// Token: 0x0600136B RID: 4971 RVA: 0x0031EDEC File Offset: 0x0031CFEC
		public virtual void increaseLevel()
		{
			this.curLevel++;
		}

		// Token: 0x0600136C RID: 4972 RVA: 0x0031EDFC File Offset: 0x0031CFFC
		public virtual void decreaseLevel()
		{
			if (this.indentLevels.ContainsKey(new int?(this.curLevel)))
			{
				this.indentLevels[new int?(this.curLevel)].Clear();
			}
			this.curLevel--;
		}

		// Token: 0x0400149E RID: 5278
		private int curLevel;

		// Token: 0x0400149F RID: 5279
		private IDictionary<int?, IList<KeywordAlignMediator.IndentLevelItem>> indentLevels = new Dictionary<int?, IList<KeywordAlignMediator.IndentLevelItem>>();

		// Token: 0x0200044F RID: 1103
		public class IndentLevelItem
		{
			// Token: 0x06002994 RID: 10644 RVA: 0x0033E7ED File Offset: 0x0033C9ED
			public IndentLevelItem()
			{
			}

			// Token: 0x06002995 RID: 10645 RVA: 0x0033E7F5 File Offset: 0x0033C9F5
			public IndentLevelItem(int level, int indentLen, TSourceToken token)
			{
				this.level = level;
				this.indentLen = indentLen;
				this.token = token;
			}

			// Token: 0x1700098A RID: 2442
			// (get) Token: 0x06002996 RID: 10646 RVA: 0x0033E812 File Offset: 0x0033CA12
			// (set) Token: 0x06002997 RID: 10647 RVA: 0x0033E81A File Offset: 0x0033CA1A
			public virtual int Level
			{
				get
				{
					return this.level;
				}
				set
				{
					this.level = value;
				}
			}

			// Token: 0x1700098B RID: 2443
			// (get) Token: 0x06002998 RID: 10648 RVA: 0x0033E823 File Offset: 0x0033CA23
			// (set) Token: 0x06002999 RID: 10649 RVA: 0x0033E82B File Offset: 0x0033CA2B
			public virtual int IndentLen
			{
				get
				{
					return this.indentLen;
				}
				set
				{
					this.indentLen = value;
				}
			}

			// Token: 0x1700098C RID: 2444
			// (get) Token: 0x0600299A RID: 10650 RVA: 0x0033E834 File Offset: 0x0033CA34
			// (set) Token: 0x0600299B RID: 10651 RVA: 0x0033E83C File Offset: 0x0033CA3C
			public virtual TSourceToken Token
			{
				get
				{
					return this.token;
				}
				set
				{
					this.token = value;
				}
			}

			// Token: 0x04001ECF RID: 7887
			internal int level;

			// Token: 0x04001ED0 RID: 7888
			internal int indentLen;

			// Token: 0x04001ED1 RID: 7889
			internal TSourceToken token;
		}
	}
}
